<?php
// +-------------+--------------+------+-----+---------+----------------+
// | Field       | Type         | Null | Key | Default | Extra          |
// +-------------+--------------+------+-----+---------+----------------+
// | id          | int(11)      | NO   | PRI | NULL    | auto_increment |
// | name        | varchar(30)  | NO   |     |         |                |
// | title       | varchar(30)  | NO   |     |         |                |
// | type        | tinyint(1)   | NO   |     | 1       |                |
// | status      | tinyint(1)   | NO   |     | 1       |                |
// | condition   | varchar(100) | NO   |     |         |                |
// | parent_id   | int(11)      | NO   |     | 0       |                |
// | icon        | varchar(30)  | NO   |     |         |                |
// | islink      | tinyint(1)   | NO   |     | 1       |                |
// | sort        | tinyint(1)   | NO   |     | 1       |                |
// | tips        | varchar(50)  | NO   |     |         |                |
// | editor_id   | int(11)      | NO   |     | 0       |                |
// | create_time | int(11)      | NO   |     | 0       |                |
// | update_time | int(11)      | NO   |     | 0       |                |
// +-------------+--------------+------+-----+---------+----------------+
namespace app\admin\validate;
use think\Validate;
class AuthRule extends Validate{
  protected $rule = [
    "rule_type" => "require|in:member,manager",
    "title" => "require|min:2|max:30",
    "name" => "max:30",
    "sort" => "require|between:0,9999",
    "icon" => "max:50",
  ];

  protected $message = [
    "rule_type.require" => "权限组类型不能为空",
    "rule_type.in" => "权限组类型不正确",
    "title.require" => "菜单名称不能为空",
    "title.max" => "菜单名称不能超过30个字符",
    // "name.require" => "页面链接不能为空",
    "name.max" => "页面链接不能超过30个字符",
    "icon.max" => "ICON图标不能超过30个字符",
    "sort.between" => "排序编号必须在0-9999之间",
  ];
}